package com.ruibang.glass.produce.entity;

import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.*;
import com.ruibang.glass.common.utils.validateannotation.NotBlank;
import com.teaming.cloud.framework2.common.pojo.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.Valid;
import javax.validation.constraints.NotNull;
import java.time.LocalDateTime;
import java.util.List;

/**
 * <p>
 * 溶解缺陷取样
 * </p>
 *
 * @author songJinKang
 * @since 2024-04-28
 */

@ApiModel(value = "溶解缺陷取样")
@TableName("g_produce_defect_sample")
@Data
public class DefectSample extends BaseEntity {
    @ApiModelProperty(value = "取样ID")
    @TableId(value = "sample_id", type = IdType.ASSIGN_ID)
    private String sampleId;
    @ApiModelProperty(value = "数据时间")
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    @NotNull(message = "数据时间不可为空")
    private LocalDateTime dataTime;
    @ApiModelProperty(value = "创建用户ID不可为空")
    @NotBlank(message = "创建人用户ID")
    private String createUserId;
    @NotNull(message = "创建人用户名称")
    private String createUserName;
    @ApiModelProperty(value = "气泡占比")
    @NotNull(message = "气泡占比不可为空")
    private Double bubbleRate;
    @ApiModelProperty(value = "结石占比")
    @NotNull(message = "结石占比不可为空")
    private Double stoneRate;
    @ApiModelProperty(value = "铂金占比")
    @NotNull(message = "铂金占比不可为空")
    private Double ptRate;
    @ApiModelProperty(value = "总占比")
    @NotNull(message = "总占比不可为空")
    private Double totalRate;
    @ApiModelProperty(value = "是否删除")
    @TableLogic
    private String isDelete;
    @TableField(exist = false)
    @ApiModelProperty("溶解缺陷项目")
    @Valid
    private List<DefectSampleItem> defectSampleItems;
}
